<?php
require_once("../model/contact.php");

$obj_contact = new Contact();

$data = $obj_contact->get_all_contact();

echo "<table class=\"table table-striped\"";
echo "<thead>";
    echo "<th>Công ty/Cá nhân</th>";
    echo "<th>Địa chỉ</th>";
    echo "<th>Email</th>";
    echo "<th>Điện thoại</th>";
    echo "<th>Nội dung</th>";
    echo "<th>Tác vụ</th>";
echo "</thead>";
echo "<tbody>";
foreach($data as $key=>$value)
{
    $contact_id = $value['contact_id'];
    echo "<tr>";
        echo "<td>".$value['company_name']."</td>";
        echo "<td>".$value['address']."</td>";
        echo "<td>".$value['email']."</td>";
        echo "<td>".$value['telephone']."</td>";
        echo "<td>".$value['content']."</td>";
        echo "<td><a class=\"del_contact\" href=\"javascript:void(0)\" onclick=\"del_contact_by_id($contact_id)\">Xóa</a></td>";
    echo "</tr>";
}
echo "</tbody>";
echo "</table>";